Skip to content

Fix progress logging with Dask v2026#3154

Merged
bouweandela merged 1 commit into
mainfrom
fix-dask-logging
Jul 9, 2026
Merged

Fix progress logging with Dask v2026#3154
bouweandela merged 1 commit into
mainfrom
fix-dask-logging

Conversation

@bouweandela

@bouweandela bouweandela commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Update the way the Dask progress loggers work:

  • configure logging in the process from which the progress loggers are run. This fixes the issue of the progress loggers not showing.
  • pass in an esmvalcore.config.Session instead of relying on the global esmvalcore.config.CFG variable, which will revert to the default in a different process, when setting up the progress bars. This fixes the issue that when max_parallel_tasks is set to a different value from the command line, the right kind of progress bar (Rich based if max parallel tasks = 1 and logger style if larger than 1) is not selected.
  • Add a bunch of type hints

I had to make quite a few changes in order to pass the session down to where logging progress is set up.

Closes #3121
Helps with #2954


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.25%. Comparing base (0bb7e86) to head (9c3038f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3154   +/-   ##
=======================================
  Coverage   96.25%   96.25%           
=======================================
  Files         273      273           
  Lines       16188    16194    +6     
=======================================
+ Hits        15581    15587    +6     
  Misses        607      607           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bouweandela bouweandela marked this pull request as ready for review July 8, 2026 12:44
@bouweandela bouweandela requested a review from schlunma July 8, 2026 12:55

@schlunma schlunma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I tested all cases I could think of (cartesian product of dask.use="local_threaded"/"local_distributed", max_parallel_tasks=1/2, log_progress_interval=-1/0/1). Everything looks as expected!

Just one tiny comment on the code.

Comment thread esmvalcore/preprocessor/__init__.py
@schlunma schlunma added this to the v2.15.0 milestone Jul 9, 2026
@schlunma

schlunma commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Regarding the label: This is again an example of a PR that fixes something that was never broken in a release (ESMValGroup/ESMValTool#4389). We still do not have an appropriate label for this.

@bouweandela bouweandela added the issue introduced since last release A bug that was introduced during development but is not part of a released version of the software. label Jul 9, 2026
@bouweandela

Copy link
Copy Markdown
Member Author

Thanks for reviewing ✨ I created the label with the name @ehogan suggested and added it to this pull request.

@bouweandela bouweandela merged commit 4d73190 into main Jul 9, 2026
5 checks passed
@bouweandela bouweandela deleted the fix-dask-logging branch July 9, 2026 15:19
@valeriupredoi

Copy link
Copy Markdown
Contributor

unreal - I am stumped to see so much code change needed to make a progress bar work - Dask is really giving us more grief than joy. Many thanks @bouweandela and @schlunma - sorry I was tied up elsewhere today 🍺

@bouweandela

Copy link
Copy Markdown
Member Author

It's mostly technical debt on our side, i.e. #2954 and missing type hints.

flicj191 pushed a commit that referenced this pull request Jul 10, 2026
@flicj191 flicj191 mentioned this pull request Jul 10, 2026
@bouweandela bouweandela changed the title Fix dask progress logging Fix progress logging with Dask v2026 Jul 10, 2026
@bouweandela bouweandela added installation Installation problem and removed issue introduced since last release A bug that was introduced during development but is not part of a released version of the software. labels Jul 10, 2026
@bouweandela

Copy link
Copy Markdown
Member Author

Relabelled this as installation because it is needed to support newer versions of Dask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installation Installation problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress logging does not work with Dask/Distributed 2026.6

3 participants